 $(document).ready(function() {
     initMultiStep();
    });
    
function initMultiStep()
{
    $('.modal').MultiStep({
    title:'Multi modal',
    data:[
    {
        label:'第一步',
        skip:false,
        content:`
        <div class="form-group">
            <label for="exampleInputName">名字</label>
            <input type="text" class="form-control" id="exampleInputName">
          </div>
        `,
    },{
        label:'第二步',
        skip:false,
        content:`<small>2222222222222222222222</small>`,
    },
    {
        label:'第三步',
        skip:false,
        content:`<small>33333333333333333333333333333</small>`,
    },            
    ],
    // final:`<div class="form-group">
            // <label for="exampleInputEmail1">Email address</label>
            // <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
            // <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
          // </div>`,
    modalSize:'lg',
    finishEvent:finishSubmit,
});
}

function finishSubmit()
{
    console.log('submit');
    $modal_obj=$(this).parents(".modal");
    $modal_obj.modal('hide');
}

$("#submitModal").on("shown.bs.modal",function(event){
    var $obj = $(event.relatedTarget);//获取事件元素, 并转为jQuery对象
    var itemdata = $obj.data("itemdata");//根据data方法获取绑定的数据
    //console.log($(this).find(".form-control")[0]);//this即指modal元素
})